<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>电力消费数据分析</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.0/font/bootstrap-icons.css">
    <link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
</head>
<body>
    <!-- 导航栏 -->
    <nav class="navbar navbar-expand-lg navbar-dark bg-primary fixed-top">
        <div class="container">
            <a class="navbar-brand fw-bold" href="#">
                <i class="bi bi-lightning-charge me-2"></i>电力消费数据分析历史记录
            </a>
            <div class="collapse navbar-collapse" id="navbarNav">
                <ul class="navbar-nav me-auto">
                    <li class="nav-item"></li>
                </ul>
                <ul class="navbar-nav">
                    <li class="nav-item">
                        <a class="nav-link" href="#data-analysis" id="dataAnalysisTab">
                            <i class="bi bi-graph-up me-1"></i>数据分析
                        </a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="#data-forecast" id="dataForecastTab">
                            <i class="bi bi-magic me-1"></i>数据预测
                        </a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="#history" id="historyTab">
                            <i class="bi bi-clock-history me-1"></i>历史记录
                        </a>
                    </li>
                </ul>
            </div>
        </div>
    </nav>

    <div class="container mt-5 pt-4">  <!-- 添加pt-4给导航栏留出空间 -->
        <!-- 原有内容保持不变 -->
        <h1 class="text-left mb-4">电力消费预测分析</h1>

        <!-- 原有卡片和表格内容 -->
        <div class="row">
            <div class="col-md-6 mb-4">
                <div class="card h-100">
                    <div class="card-header">
                        <h2>数据集基本统计</h2>
                    </div>
                    <div class="card-body">
                        <div class="table-responsive">
                            <table class="table table-striped">
                                <thead>
                                    <tr>
                                        <th>属性</th>
                                        <th>最大值</th>
                                        <th>最小值</th>
                                        <th>均值</th>
                                        <th>标准差</th>
                                    </tr>
                                </thead>

                            </table>
                        </div>
                    </div>
                </div>
            </div>

            <div class="col-md-6 mb-4">
                <div class="card h-100">
                    <div class="card-header">
                        <h3>相关性热力图</h3>
                    </div>
                    <div class="card-body">
                        <img src="data:image/png;base64,{{ charts.heatmap }}" class="img-fluid" alt="相关性热力图">
                    </div>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-md-6 mb-4">
                <div class="card h-100">
                    <div class="card-header">
                        <h3>节假日影响</h3>
                    </div>
                    <div class="card-body">
                        <img src="data:image/png;base64,{{ charts.bar_chart }}" class="img-fluid" alt="月度平均电力消费">
                    </div>
                </div>
            </div>

            <div class="col-md-6 mb-4">
                <div class="card h-100">
                    <div class="card-header">
                        <h3>相关性分析</h3>
                    </div>
                    <div class="card-body">
                        <h4>玫瑰图</h4>
                    </div>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-md-12 mb-4">
                <div class="card h-100">
                    <div class="card-header">
                        <h3>电力消费与其他特征的关系</h3>
                    </div>
                    <div class="card-body text-center">
                        <img src="data:image/png;base64,{{ charts.line_chart }}" class="img-fluid" alt="电力消费趋势">
                    </div>
                </div>
            </div>
        </div>
    </div>

    </div>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
    <script src="{{ url_for('static', filename='js/scripts.js') }}"></script>
    <script>
        document.getElementById('dataAnalysisTab').addEventListener('click', function() {
            window.location.href ="{{ url_for('data_analysis') }}";
            console.log('数据分析标签被点击');
        });

        document.getElementById('dataForecastTab').addEventListener('click', function() {
            window.location.href = "{{ url_for('data_yuce') }}";
            console.log('数据预测标签被点击');
        });

        document.getElementById('historyTab').addEventListener('click', function() {
             window.location.href = "{{ url_for('data_history') }}";
            console.log('历史记录标签被点击');
        });
    </script>
</body>
<footer class="footer mt-auto py-3 bg-light">
        <div class="container text-center">
            <span class="text-muted">© 2025电力消费数据分析系统</span>
        </div>
</footer>
</html>